/* Name      = DROPDOWN_1.6.5
 * Datei     = Anleitung.txt
 * Info      = getestet unter PHPKIT 1.6.5
 * First     = 1.0.0
 * Version   = 1.0.0
 * Datum     = 18.01.2010
 * Copyright = -[ESA]-Lucky
 * Homepage  = http://www.esa-clan.de
 * eMail     = esa@esa-clan.de
 * Support   = http://www.esa-clan.de/include.php?path=forum/main.php
 * * * * * * * * * * * * * * * * * * */

Dropdown NUR fr PHPKIT 1.6.5
#############################
--------------------------------------------------------------------------------------------------------------------
Infos:
--------------------------------------------------------------------------------------------------------------------
NEUHEIT
- Ihr knnt nun auch Dropdowns erstellen

Bsp.
Ihr erstellt oder editiert ein Profilfeld. Hierbei knnt ihr nun einen Haken setzen wenn das Feld ein Dropdown werden soll.
In der bersicht der Profilfelder steht nun in der Spalte DD ein rotes Ja was ihr anklicken msst. In diesem Menue knnt ihr nun die Felder fr den Dropdown erstellen, editieren oder lschen. Wenn nun ein Feld erstellt wurde ist das Ja in der bersicht grn.
WICHTIG!!!!
Kontrolliert das ein Dropdown auch eine Auswahlmglichkeit hat. Wenn ein DD als Pflichtfeld deklariet ist und es befindet sich darin keine Auswahl, knnen User ihr Profil nicht mehr editieren bzw. auch nicht mehr registrieren.
Vermeidet alte Profilfelder nachtrglich als Dropdown zu deklarieren. Die User wissen das nicht und bei der nchsten Speicherung sind seine Daten weg. Oder macht dann dieses Feld als Pflichtfeld^^

--------------------------------------------------------------------------------------------------------------------
Voraussetzung:
--------------------------------------------------------------------------------------------------------------------
Ihr habt meinen Pflichfelderhack installiert.
http://www.esa-clan.de/include.php?path=content/download.php&contentid=253
--------------------------------------------------------------------------------------------------------------------
Installation:
--------------------------------------------------------------------------------------------------------------------
!!! Wie immer gilt, zuerst Backup der Originaldateien sowie der Datenbank machen. !!!

Kopiere ausser der Anleitung alle Dateien aus dem Ordner dropdown_1.6.5 ins Rootverzeichnis vom PHPKIT.
Nun fhrt die install.php mit folgendem Pfad aus.
http://www.deinedomain.de/zumrootverzeichnis/include.php?path=install


Lsche nach der Installation die pkinc/public/install.php

Jetzt msst Ihr folgende Dateien manuell anpassen.

--------------------------------------------------------------------------------------------------------------------
ADMINBEREICH:
--------------------------------------------------------------------------------------------------------------------
####################################################################################################################
----------->
Editiere die pkinc/admin/userprofilefields.php
----------->
SUCHE:
		$SQL->query("DELETE FROM ".pkSQLTAB_USER_PROFILEFIELDS." WHERE profilefields_id='".intval($_POST['id'])."'");

FGE DARUNTER DAS EIN:
/********************* Dropdown Anfang *********************/
		$SQL->query("DELETE FROM `".pkSQLPREFIX."_dropdown` WHERE `id_field`='".intval($_POST['id'])."'");
/********************* Dropdown Ende ***********************/


SUCHE:
				profilefields_forum_description='".$SQL->f($_POST['field_forum_description'])."',

FGE DARUNTER DAS EIN:
/********************* Dropdown Anfang *********************/
				profilefields_drop_down='".$SQL->f($_POST['field_drop_down'])."',
/********************* Dropdown Ende ***********************/


SUCHE:
		$fieldid=$profilefield['profilefields_id'];
		$fieldname=pkEntities($profilefield['profilefields_name']);
		$fielddescription=pkEntities($profilefield['profilefields_description']);

FGE DARUNTER DAS EIN:
/********************* Dropdown Anfang *********************/
   if($profilefield['profilefields_drop_down']==1) $field_dropdown=' checked="checked"'; else $field_dropdown='';
/********************* Dropdown Ende ***********************/


SUCHE:
	eval("\$profilefields_row.= \"".pkTpl("profilefields_row")."\";");

FGE DIREKT DARBER das ein:
/********************* Dropdown Anfang *********************/
$drop_yes_field=$edit_drop=$profilefields_area=$dropdown_ok='';
$drop_search=$SQL->fetch_array($SQL->query("SELECT count(id) FROM `".pkSQLPREFIX."_dropdown` WHERE `id_field`='".intval($profilefields['profilefields_id'])."' LIMIT 1"));
   if($drop_search[0]>0 or $profilefields['profilefields_drop_down']==1) {
    if($drop_search[0]>0) {
       $drop_yes_field='<span style="color:#12ef00;">'; $drop_yes_field_1='<span>';
       } else {
       $drop_yes_field='<span style="color:#d70007;">'; $drop_yes_field_1='<span>';
       }
   $edit_drop=trim($profilefields['profilefields_id']);
   eval ("\$dropdown_ok= \"".pkTpl("profilefields_drop_yes")."\";");
   $profilefields_area='-';
   $profilefields_area='-';
   } else {
   eval ("\$dropdown_ok= \"".pkTpl("profilefields_drop_no")."\";");
   }
/********************* Dropdown Ende   *********************/
####################################################################################################################
----------->
Editiere die pkinc/admin/useredit.php
----------->
SUCHE:
		if(empty($profilefields['profilefields_pflicht']) AND empty($profilefields['profilefields_area'])){ unset($pflichtfeld);

ERSETZE DIESE ZEILE HIERMIT:
/********************* Dropdown Anfang *********************/
		if($profilefields['profilefields_drop_down']==1) {
		$getdrops=$SQL->query("SELECT * FROM `".pkSQLPREFIX."_dropdown` WHERE `id_field`='".intval($profilefields['profilefields_id'])."' ORDER by `id_sort` ASC");
		$info_drop='';
		while ($drops=$SQL->fetch_array($getdrops)) {
		$info_drop.='<option value="'.$drops['text'].'"';
		if ($fieldcontent==$drops['text']) $info_drop.=' selected="selected"';
		$info_drop.='>'.pkEntities(trim($drops['text'])).'</option>';
		}
		if($profilefields['profilefields_pflicht']=="1") {$pflichtfeld='<span style="color:#d70007;">*</span>';}
		eval ("\$edituser_profilefields.= \"".pkTpl("edituser_profilefields_drop")."\";");
		unset($info_drop); unset($pflichtfeld);}
		elseif(empty($profilefields['profilefields_pflicht']) AND empty($profilefields['profilefields_area'])){ unset($pflichtfeld);
/********************* Dropdown Ende ***********************/
####################################################################################################################
----------->
Editiere die pkinc/admintpl/profilefields.htm
----------->
ERSETZE den kompletten Inhalt HIERMIT:
<table class="standard" border="0" cellspacing="1" cellpadding="4" width="100%">
 <tr>
  <td class="heads" colspan="14">Profilfelder</td> </tr> <tr>
  <td class="highlight" width="8%"><font class="small">Gruppe</font></td>
  <td class="highlight" width="1%"><font class="small">Sort</font></td>
  <td class="highlight" width="1%"><font class="small">Nr.</font></td>
  <td class="highlight" width="5%"><font class="small">Look</font></td>
  <td class="highlight" width="5%"><font class="small">Edit</font></td>
  <td class="highlight" width="20%"><font class="small">Feldname</font></td>
  <td class="highlight" width="10%"><font class="small">Beschreibung</font></td>
<!-- Dropdown -->
  <td class="highlight" width="5%" align="center"><font class="small">DD</font></td>
<!-- Dropdown -->
  <td class="highlight" width="6%" align="center"><font class="small">Pflicht</font></td>
  <td class="highlight" width="5%" align="center"><font class="small">Info</font></td>
  <td class="highlight" width="7%"><font class="small">BBCode</font></td>
  <td class="highlight" width="8%" align="center"><font class="small">Forum</font></td>
  <td class="highlight" width="16%" colspan="2" align="center"><font class="small">Optionen</font></td>
 </tr>
	$profilefields_row
 <tr>
  <td class="highlight" colspan="14" align="right"><a href="admin.php?path=userprofilefields&amp;id=new"><b>Neues Feld erzeugen</b></a></td>
 </tr>
</table>
####################################################################################################################
----------->
Editiere die pkinc/admintpl/profilefields_form.htm
----------->
SUCHE fast ganz unten das hier:
 <tr>
  <td class="left">Zeichenbegrenzung im Forum<br />
      <font class="small">&nbsp;</font></td>
  <td class="right"><input type="text" name="field_cut" value="$fieldcut" size="3" /></td>
 </tr>

FGE DARUNTER DAS EIN:
<!-- Dropdown -->
 <tr>
  <td class="left" valign="top">Als Dropdown erstellen?</td>
  <td class="right"><font class="small"> 
	<input class="checkbox" type="checkbox" value="1" name="field_drop_down" $field_dropdown /> Haken setzen</font></td>
 </tr>
<!-- Dropdown -->
####################################################################################################################
----------->
Editiere die pkinc/admintpl/profilefields_row.htm
----------->
ERSETZE den kompletten Inhalt HIERMIT:
 <tr>
  <td class="$row" align="center">$profilefields[profilefields_groups]</td>
  <td class="$row" align="center">$profilefields[profilefields_sorts]</td>
  <td class="$row" align="center">$profilefields[profilefields_order]</td>
  <td class="$row" align="center">$profilefields[profilefields_status]</td>
  <td class="$row" align="center">$profilefields[profilefields_status_edit]</td>
  <td class="$row">$profilefields[profilefields_name]</td>
  <td class="$row">$profilefields[profilefields_description]</td>
<!-- Dropdown -->
  <td class="$row" align="center">$dropdown_ok</td>
<!-- Dropdown -->
  <td class="$row" align="center">$profilefields_pflicht</td> 
  <td class="$row" align="center">$profilefields_area</td>
  <td class="$row" align="center">$bbcode_ok</td>
  <td class="$row" align="center">$profilefields_forum</td>
  <td class="$row" width="10%" align="center"><a href="admin.php?path=userprofilefields&amp;action=edit&amp;id=$profilefields[profilefields_id]">bearbeiten</a></td>
  <td class="$row" width="10%" align="center"><a href="admin.php?path=userprofilefields&amp;action=drop&amp;id=$profilefields[profilefields_id]"><font class="highlight">l&#246;schen</font></a></td>
  </tr>
####################################################################################################################

--------------------------------------------------------------------------------------------------------------------
HOMEPAGE:
--------------------------------------------------------------------------------------------------------------------
####################################################################################################################
----------->
Editiere die pkinc/public/userprofile.php
----------->
SUCHE:
			if($felder['profilefields_area']==2){

ERSETZE DIE ZEILE HIERMIT:
			if($felder['profilefields_area']==2 AND $felder['profilefields_drop_down']==0){


SUCHE:
			profilefields_bbcode

ERSETZE ALLES HIERMIT:
			profilefields_bbcode,
			profilefields_drop_down


SUCHE:
,$fieldarea,$fieldbbcode

FGE DIREKT DAHINTER DAS EIN:
,$fielddrop


SUCHE:
			if($fieldpflicht=="0" AND $fieldarea=="0"){ unset($pflichtfeld);

ERSETZE DIESE ZEILE HIERMIT:
/********************* Dropdown Anfang *********************/
			if($fielddrop==1) {
			$getdrops=$SQL->query("SELECT * FROM `".pkSQLPREFIX."_dropdown` WHERE `id_field`='".intval($fieldid)."' ORDER by `id_sort` ASC"); 
			while ($drops=$SQL->fetch_array($getdrops)) {
			$info_drop.='<option value="'.$drops['text'].'"';
			if ($value==$drops['text']) $info_drop.=' selected="selected"';
			$info_drop.='>'.pkEntities(trim($drops['text'])).'</option>';
			}
			if($fieldpflicht==1) $pflichtfeld='<span style="color:#d70007;">*</span>';
			eval ("\$editprofile_userfield.= \"".pkTpl("usereditprofile_userfield_drop")."\";");
			unset($info_drop);
			unset($pflichtfeld);}
			elseif($fieldpflicht=="0" AND $fieldarea=="0"){ unset($pflichtfeld);
/********************* Dropdown Ende ***********************/
####################################################################################################################
----------->
Editiere die pkinc/public/registration.php
----------->
SUCHE:
		if($felder['profilefields_area']==2){

ERSETZE DIESE ZEILE HIERMIT:
		if($felder['profilefields_area']==2 AND $felder['profilefields_drop_down']==0){


SUCHE:
	if($info_feld['profilefields_pflicht']=="0" AND $info_feld['profilefields_area']=="0"){ unset($pflichtfeld);

ERSETZE DIESE ZEILE HIERMIT:
/********************* Dropdown Anfang *********************/
	if($info_feld['profilefields_drop_down']==1) {
	$getdrops=$SQL->query("SELECT * FROM `".pkSQLPREFIX."_dropdown` WHERE `id_field`='".intval($info_feld['profilefields_id'])."' ORDER by `id_sort` ASC"); 
	while ($drops=$SQL->fetch_array($getdrops)) {
	$info_drop.='<option value="'.$drops['text'].'"';
	if ($value==$drops['text']) $info_drop.=' selected="selected"';
	$info_drop.='>'.pkEntities(trim($drops['text'])).'</option>';
	}
	if($info_feld['profilefields_drop_down']==1) $pflichtfeld='<span style="color:#d70007;">*</span>';
	eval ("\$editprofile_userfield.= \"".pkTpl("register_userfield_drop")."\";");
	unset($info_drop);
	unset($pflichtfeld);}
	elseif($info_feld['profilefields_pflicht']=="0" AND $info_feld['profilefields_area']=="0"){ unset($pflichtfeld);
/********************* Dropdown Ende ***********************/
####################################################################################################################

Das war es auch schon.

Nutzungsbedingungen
###################

1. Es ist nicht erlaubt das Script zu verndern und zum Download anzubieten!
   Es ist auch nicht erlaubt, es im Originalzustand weiterzugeben!

2. Der Copyright Hinweis darf nicht entfernt, verndert oder unkenntlich gemacht werden! 

3. Das Script darf weder als Ganzes noch in Teilen weitergegeben werden!


Mit dem Einsatz des Scriptes stimmst du diese Bedingungen zu.

Fr Fragen oder Anregungen:
#############################
www.esa-clan.de
esa@esa-clan.de
Gru//Lucky